cpupool: Strict parameter checking for cpupool operations
authorKeir Fraser <keir@xen.org>
Wed, 9 Feb 2011 08:44:38 +0000 (08:44 +0000)
committerKeir Fraser <keir@xen.org>
Wed, 9 Feb 2011 08:44:38 +0000 (08:44 +0000)
Some cpupool actions didn't check the cpupool_id exactly. For some
actions this doesn't make any sense, so refuse those actions if the
specified cpupool doesn't exist.

Signed-off-by: Juergen Gross <juergen.gross@ts.fujitsu.com>
xen/common/cpupool.c

index b90e5c03711f36f70c82e241472fd3d1796ceefa..16a1f43d29a502b06a92d930cc21631f522e0902 100644 (file)
@@ -485,7 +485,7 @@ int cpupool_do_sysctl(struct xen_sysctl_cpupool_op *op)
         ret = -EBUSY;
         if ( !cpu_isset(cpu, cpupool_free_cpus) )
             goto addcpu_out;
-        c = cpupool_find_by_id(op->cpupool_id, 0);
+        c = cpupool_find_by_id(op->cpupool_id, 1);
         ret = -ENOENT;
         if ( c == NULL )
             goto addcpu_out;
@@ -501,7 +501,7 @@ int cpupool_do_sysctl(struct xen_sysctl_cpupool_op *op)
     {
         unsigned cpu;
 
-        c = __cpupool_get_by_id(op->cpupool_id, 0);
+        c = __cpupool_get_by_id(op->cpupool_id, 1);
         ret = -ENOENT;
         if ( c == NULL )
             break;